#########################################################################
# Dependency compulation
# ############################
$(ATTACKER_BASEDIR)/dep/%.d: $(ATTACKER_BASEDIR)/src/%.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "#################################################################"
	@echo " Generating $@"
	@echo "##########"
	@mkdir -p $(shell dirname $@)
	$(BASEDIR)/scripts/depend.sh 'dirname $@'/debug $(ATTACKER_INCFLAGS) $< >$@
	$(BASEDIR)/scripts/depend.sh 'dirname $@'/release $(ATTACKER_INCFLAGS) $< >>$@

########################################################################
# Object compilation
# ##############################
$(ATTACKER_BASEDIR)/obj/debug/%.o: $(ATTACKER_BASEDIR)/src/%.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "#############################################################"
	@echo " Generating $@"
	@echo "#################"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c -DATTACKERN=0 $(ATTACKER_DEBUG_CFLAGS) $< -o $@

$(ATTACKER_BASEDIR)/obj/release/%.o: $(ATTACKER_BASEDIR)/src/%.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "##############################################################"
	@echo " Generating $@"
	@echo "###############"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c $(ATTACKER_RELEASE_CFLAGS) $< -o $@

$(ATTACKER_BASEDIR)/obj/release/attacker1.o: $(ATTACKER_BASEDIR)/src/attacker.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "##############################################################"
	@echo " Generating $@"
	@echo "###############"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c -DATTACKERN=1 $(ATTACKER_RELEASE_CFLAGS) $< -o $@
$(ATTACKER_BASEDIR)/obj/release/attacker2.o: $(ATTACKER_BASEDIR)/src/attacker.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "##############################################################"
	@echo " Generating $@"
	@echo "###############"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c -DATTACKERN=2 $(ATTACKER_RELEASE_CFLAGS) $< -o $@

$(ATTACKER_BASEDIR)/obj/release/attacker3.o: $(ATTACKER_BASEDIR)/src/attacker.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "##############################################################"
	@echo " Generating $@"
	@echo "###############"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c -DATTACKERN=3 $(ATTACKER_RELEASE_CFLAGS) $< -o $@
$(ATTACKER_BASEDIR)/obj/release/attacker4.o: $(ATTACKER_BASEDIR)/src/attacker.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "##############################################################"
	@echo " Generating $@"
	@echo "###############"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c -DATTACKERN=4 $(ATTACKER_RELEASE_CFLAGS) $< -o $@
$(ATTACKER_BASEDIR)/obj/release/attacker5.o: $(ATTACKER_BASEDIR)/src/attacker.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "##############################################################"
	@echo " Generating $@"
	@echo "###############"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c -DATTACKERN=5 $(ATTACKER_RELEASE_CFLAGS) $< -o $@
$(ATTACKER_BASEDIR)/obj/release/attacker6.o: $(ATTACKER_BASEDIR)/src/attacker.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "##############################################################"
	@echo " Generating $@"
	@echo "###############"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c -DATTACKERN=6 $(ATTACKER_RELEASE_CFLAGS) $< -o $@

$(ATTACKER_BASEDIR)/obj/release/attacker7.o: $(ATTACKER_BASEDIR)/src/attacker.cpp $(BASEDIR)/Makefile $(ATTACKER_BASEDIR)/module.mk $(ATTACKER_BASEDIR)/rules.mk
	@echo 
	@echo "##############################################################"
	@echo " Generating $@"
	@echo "###############"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_CC) -c -DATTACKERN=7 $(ATTACKER_RELEASE_CFLAGS) $< -o $@
#######################################################################
# Target executable generating
# ####################################
$(BASEDIR)/bin/debug/$(ATTACKER): $(ATTACKER_DEBUG_OBJS) $(patsubst %, $(BASEDIR)/lib/debug/lib%.so, $(ATTACKER_MODULES_DEPENDENCIES))
	@echo 
	@echo "#################################################"
	@echo " Generating $@"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_LD) $(ATTACKER_DEBUG_OBJS) $(ATTACKER_DEBUG_LDFLAG) $(ATTACKER_DEBUG_LIBS) -o $@

$(BASEDIR)/bin/release/$(ATTACKER)1: $(ATTACKER_BASEDIR)/obj/release/attacker1.o $(ATTACKER_RELEASE_OBJS) $(patsubst %, $(BASEDIR)/lib/release/lib%.so, $(ATTACKER_MODULES_DEPENDENCIES))
	@echo 
	@echo "#################################################"
	@echo " Generating $@"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_LD) $(ATTACKER_BASEDIR)/obj/release/attacker1.o $(ATTACKER_RELEASE_OBJS) $(ATTACKER_RELEASE_LDFLAG) $(ATTACKER_RELEASE_LIBS) -o $@

$(BASEDIR)/bin/release/$(ATTACKER)2: $(ATTACKER_BASEDIR)/obj/release/attacker2.o $(ATTACKER_RELEASE_OBJS) $(patsubst %, $(BASEDIR)/lib/release/lib%.so, $(ATTACKER_MODULES_DEPENDENCIES))
	@echo 
	@echo "#################################################"
	@echo " Generating $@"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_LD) $(ATTACKER_BASEDIR)/obj/release/attacker2.o $(ATTACKER_RELEASE_OBJS) $(ATTACKER_RELEASE_LDFLAG) $(ATTACKER_RELEASE_LIBS) -o $@

$(BASEDIR)/bin/release/$(ATTACKER)3:$(ATTACKER_BASEDIR)/obj/release/attacker3.o $(ATTACKER_RELEASE_OBJS) $(patsubst %, $(BASEDIR)/lib/release/lib%.so, $(ATTACKER_MODULES_DEPENDENCIES))
	@echo 
	@echo "#################################################"
	@echo " Generating $@"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_LD) $(ATTACKER_BASEDIR)/obj/release/attacker3.o $(ATTACKER_RELEASE_OBJS) $(ATTACKER_RELEASE_LDFLAG) $(ATTACKER_RELEASE_LIBS) -o $@
$(BASEDIR)/bin/release/$(ATTACKER)4:$(ATTACKER_BASEDIR)/obj/release/attacker4.o $(ATTACKER_RELEASE_OBJS) $(patsubst %, $(BASEDIR)/lib/release/lib%.so, $(ATTACKER_MODULES_DEPENDENCIES))
	@echo 
	@echo "#################################################"
	@echo " Generating $@"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_LD) $(ATTACKER_BASEDIR)/obj/release/attacker4.o $(ATTACKER_RELEASE_OBJS) $(ATTACKER_RELEASE_LDFLAG) $(ATTACKER_RELEASE_LIBS) -o $@
$(BASEDIR)/bin/release/$(ATTACKER)5:$(ATTACKER_BASEDIR)/obj/release/attacker5.o $(ATTACKER_RELEASE_OBJS) $(patsubst %, $(BASEDIR)/lib/release/lib%.so, $(ATTACKER_MODULES_DEPENDENCIES))
	@echo 
	@echo "#################################################"
	@echo " Generating $@"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_LD) $(ATTACKER_BASEDIR)/obj/release/attacker5.o $(ATTACKER_RELEASE_OBJS) $(ATTACKER_RELEASE_LDFLAG) $(ATTACKER_RELEASE_LIBS) -o $@
$(BASEDIR)/bin/release/$(ATTACKER)6:$(ATTACKER_BASEDIR)/obj/release/attacker6.o $(ATTACKER_RELEASE_OBJS) $(patsubst %, $(BASEDIR)/lib/release/lib%.so, $(ATTACKER_MODULES_DEPENDENCIES))
	@echo 
	@echo "#################################################"
	@echo " Generating $@"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_LD) $(ATTACKER_BASEDIR)/obj/release/attacker6.o $(ATTACKER_RELEASE_OBJS) $(ATTACKER_RELEASE_LDFLAG) $(ATTACKER_RELEASE_LIBS) -o $@
$(BASEDIR)/bin/release/$(ATTACKER)7:$(ATTACKER_BASEDIR)/obj/release/attacker7.o $(ATTACKER_RELEASE_OBJS) $(patsubst %, $(BASEDIR)/lib/release/lib%.so, $(ATTACKER_MODULES_DEPENDENCIES))
	@echo 
	@echo "#################################################"
	@echo " Generating $@"
	@mkdir -p $(shell dirname $@)
	$(ATTACKER_LD) $(ATTACKER_BASEDIR)/obj/release/attacker7.o $(ATTACKER_RELEASE_OBJS) $(ATTACKER_RELEASE_LDFLAG) $(ATTACKER_RELEASE_LIBS) -o $@
